package com.jic.order.enums;

public enum GoodsTypeEnum {

    ORDINARY(1, "普通"),
    NO_WAREHOUSE(2, "无仓");

    private Integer code;

    private String message;

    GoodsTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public GoodsTypeEnum getByCode(Integer code){
        GoodsTypeEnum[] values = GoodsTypeEnum.values();
        for(GoodsTypeEnum value : values){
            if(value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
